﻿<!-- Copyright © 2010 James Galasyn -->
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:EmoEngineControlLibrary">

    <SolidColorBrush x:Key="VaLightBlueBrush" Color="#FF33FFFF" />
    <SolidColorBrush x:Key="VaDarkBlueBrush" Color="#FF000033" />
    <SolidColorBrush x:Key="VaMedBlueBrush" Color="#FF3364FF" />
    <SolidColorBrush x:Key="VaHeaderBrush" Color="#FF333366" />
    <SolidColorBrush x:Key="VaLightBorderBrush" Color="#FF666699" />
    <SolidColorBrush x:Key="VaDarkBorderBrush" Color="#FF333366" />

    <local:EeContactQualityToBrushConverter x:Key="contactQualityConverter" />

    <DataTemplate x:Key="EeQualityTemplate">

        <Ellipse Fill="{Binding Converter={StaticResource contactQualityConverter } }" Width="50" Height="50" DockPanel.Dock="Right" />

    </DataTemplate>

    <Style TargetType="{x:Type local:NeuroDataControl}">
        <Style.Resources>
            <DataTemplate x:Key="ListBoxItemTemplate">
                <StackPanel>
                    <Label Content="{Binding Key}" />
                </StackPanel>
            </DataTemplate>
        </Style.Resources>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:NeuroDataControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="PART_TimeSeriesControlGrid" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="10*"/>
                                <ColumnDefinition Width="100*"/>
                            </Grid.ColumnDefinitions>

                            <!--<local:ContactQualityListBox x:Name="PART_EeQualityListBox"
                                     Grid.Row="0"
                                     Grid.RowSpan="15"
                                     Grid.Column="0"
                                     VerticalAlignment="Stretch"
                                     HorizontalContentAlignment="Center"
                                     ItemsSource="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=DataFrameSource.CurrentEmotivState.ContactQualityFromAllChannels.Values }"
                                     ItemTemplate="{StaticResource EeQualityTemplate}"
                                     />-->
                        </Grid>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:TimeSeriesControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TimeSeriesControl}">
                    <Border x:Name="PART_Border" 
                            Background="{TemplateBinding Background}" 
                            BorderBrush="{StaticResource VaLightBorderBrush}" 
                            BorderThickness="1" 
                            HorizontalAlignment="Stretch"
                            Width="{TemplateBinding Width }" >
                        <Grid x:Name="PART_Grid"
                              Background="{TemplateBinding Background}"  >
                            <Polyline x:Name="PART_SignalPolyline" 
                                  StrokeThickness="{TemplateBinding TraceStrokeThickness}" 
                                  Stroke="{TemplateBinding TraceStroke}"
                                  StrokeStartLineCap="Round"
                                  StrokeEndLineCap="Round"
                                  StrokeLineJoin="Round"
                                   />

                            <TextBlock Name="PART_SignalNameTextBlock" 
                                   Text="" />

                            <TextBlock Name="PART_CurrentValueTextBlock" VerticalAlignment="Bottom" 
                                Text="" />

                            <!--<Rectangle Name="PART_SweepRect" Fill="{StaticResource VaLightBlueBrush}" Width="3"   >
                                <Rectangle.RenderTransform>
                                    <TranslateTransform x:Name="PART_SweepRectTransform" />
                                </Rectangle.RenderTransform>
                            </Rectangle>-->

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type local:SampleDisplayControl}">
        <Setter Property="TraceStroke" Value="{StaticResource VaLightBlueBrush}" />
        <Setter Property="Background" Value="{StaticResource VaDarkBlueBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:SampleDisplayControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{StaticResource VaLightBorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid x:Name="PART_Grid"
                              Background="{TemplateBinding Background}"  >
                            <Polyline x:Name="PART_SignalPolyline" 
                                  StrokeThickness="{TemplateBinding TraceStrokeThickness}" 
                                  Stroke="{TemplateBinding TraceStroke}"
                                  StrokeStartLineCap="Round"
                                  StrokeEndLineCap="Round"
                                  StrokeLineJoin="Round" />

                            <TextBlock Name="PART_SignalNameTextBlock" 
                                   Text="" />

                            <TextBlock Name="PART_CurrentValueTextBlock" VerticalAlignment="Bottom" 
                                Text="" />

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:NeuroHeadsetStatusControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:NeuroHeadsetStatusControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" >
                        <Grid>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Label Content="Headset On" Grid.Column="0" Grid.Row="0" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=HeadsetDataSource.CurrentEmotivState.HeadsetOn}" Grid.Column="1" Grid.Row="0" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="TimeFromStart" Grid.Column="0" Grid.Row="1" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=HeadsetDataSource.CurrentEmotivState.TimeFromStart}" Grid.Column="1" Grid.Row="1" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="WirelessSignalStatus" Grid.Column="0" Grid.Row="2" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=HeadsetDataSource.CurrentEmotivState.WirelessSignalStatus}" Grid.Column="1" Grid.Row="2" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="BatteryChargeLevel" Grid.Column="0" Grid.Row="3" Foreground="{TemplateBinding Foreground}" />
                            <Label Content="{Binding RelativeSource={x:Static RelativeSource.TemplatedParent}, Path=HeadsetDataSource.CurrentEmotivState.BatteryChargeLevel}" Grid.Column="1" Grid.Row="3" Foreground="{TemplateBinding Foreground}" />


                        </Grid>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>
